package com.asset.dispoal.flawPool.service;

import com.asset.dispoal.flawPool.api.FlawPoolService;
import com.asset.dispoal.flawPool.dto.FlawPoolRequest;
import com.asset.dispoal.flawPool.dto.FlawPoolResponse;
import com.asset.dispoal.flawPool.service.commom.DelFlawPoolCommand;
import com.asset.dispoal.flawPool.service.commom.InsertFlawPoolCommand;
import com.asset.dispoal.flawPool.service.commom.QueryFlawPoolCommand;
import com.asset.dispoal.flawPool.service.commom.UpdateFlawPoolCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tech.mhuang.pacebox.springboot.protocol.Result;
import tech.mhuang.pacebox.springboot.protocol.data.PageVO;

/**
 * @author qr
 * @date 2022/5/23$
 */
@Service
public class FlawPoolServiceImpl implements FlawPoolService {

    @Autowired
    QueryFlawPoolCommand queryFlawPoolCommand;

    @Autowired
    DelFlawPoolCommand delFlawPoolCommand;

    @Autowired
    InsertFlawPoolCommand insertFlawPoolCommand;

    @Autowired
    UpdateFlawPoolCommand updateFlawPoolCommand;

    @Override
    public Result insertFlawPool(FlawPoolRequest request) {
        return insertFlawPoolCommand.execute(request);
    }

    @Override
    public Result updateFlawPool(FlawPoolRequest request) {
        return updateFlawPoolCommand.execute(request);
    }

    @Override
    public Result delFlawPool(String id) {
        return delFlawPoolCommand.execute(id);
    }

    @Override
    public Result<PageVO<FlawPoolResponse>> queryFlawPool(FlawPoolRequest request) {
        return queryFlawPoolCommand.execute(request);
    }
}
